package logger

import (
	logger "github.com/alecthomas/log4go"
	"time"
)

var Logger logger.Logger

func init() {
	//logger.LoadConfiguration("log4go.xml")
	//logger.Info("log4go init ok.")

	Logger = logger.NewDefaultLogger(logger.INFO)
	Logger.AddFilter("stdout", logger.INFO, logger.NewConsoleLogWriter())                         //输出到控制台,级别为DEBUG
	Logger.AddFilter("file", logger.DEBUG, logger.NewFileLogWriter("udptokafka.log", false)) //输出到文件,级别为DEBUG,文件名为test.log,每次追加该原文件
	//l4g.LoadConfiguration("log.xml")//使用加载配置文件,类似与java的log4j.propertites
	Logger.Debug("the time is now : -- %v", time.Now())
}
